package cn.edu.zafu.bigdata.zyf;

class MathOperations {
    // 返回两个整数的和
    public int add(int a, int b) {
        return a + b;
    }

    // 返回两个浮点数的和
    public double add(double a, double b) {
        return a + b;
    }

    // 返回三个整数的和
    public int add(int a, int b, int c) {
        return a + b + c;
    }
}

public class TestMathOperations {
    public static void main(String[] args) {
        MathOperations mathOps = new MathOperations();

        // 测试两个整数相加
        int intSum = mathOps.add(5, 10);
        System.out.println("Sum of 5 and 10 (int): " + intSum);

        // 测试两个浮点数相加
        double doubleSum = mathOps.add(2.5, 3.5);
        System.out.println("Sum of 2.5 and 3.5 (double): " + doubleSum);

        // 测试三个整数相加
        int tripleSum = mathOps.add(1, 2, 3);
        System.out.println("Sum of 1, 2, and 3 (int): " + tripleSum);
    }
}